/*
 * Created on 11 Jul 2008 by Andrew White
 */

package com.volatileshooter.networking.client;

/*
 * Receives events from the ClientConnection class.
 */
public interface ClientListener {
    
    /**
     * Connection to the server has been accepted.
     * 
     * @message Server message of the day
     */
    public void accepted(String message);
    
    /**
     * Server refused to allow connection, or client has been banned.
     * 
     * @param reason String containing rejection reason
     */
    public void rejected(String reason);
    
    /**
     * Notification that a player has left the game, or that the server
     * is shutting down.
     * 
     * @param id Id of the player that has quit
     */
    public void quit(short id);
    
    /**
     * Notification that a new player has joined the game.
     * 
     * @param id Id of the new player
     * @param name Name of the new player
     */
    public void joined(short id, String name);
    
    /**
     * Chat has been received.
     * 
     * @param id Id of the client who sent the message
     * @param chat String containing the chat message
     */
    public void chat(short id, String chat);

}
